<template>
    <div>
       <el-select :value="value" placeholder="请选择" @change="fn" style="width:700px">
              <el-option
                v-for="item in catalog_options"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              ></el-option>
            </el-select>
    </div>
</template>

<script>
// 引入目录列表接口
import {simple} from '@/api/hmmm/directorys'
export default {
  name: 'my-directory',
  props: ['value'],
  created() {
    this.getCatlog()
  },
  data() {
    return {
        // 目录简单列表
      catalog_options: []
    }
  },
  methods: {
       // 获取目录信息
  async getCatlog() {
    const {data: res} = simple()
    console.log(res)
  },
  // 给父组件传值
  fn(catlogId) {
    if (catlogId === '') {
      catlogId = null
    }
    this.$emit('input', catlogId)
  }
  }
}
</script>

<style lang="less" scoped>
</style>
